package com.cbts.entity;

import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 * DepartmentMonthReportId entity. @author MyEclipse Persistence Tools
 */
@Embeddable
public class DepartmentMonthReportId implements java.io.Serializable {

	// Fields

	private String months;
	private String departmentId;

	// Constructors

	/** default constructor */
	public DepartmentMonthReportId() {
	}

	/** full constructor */
	public DepartmentMonthReportId(String months, String departmentId) {
		this.months = months;
		this.departmentId = departmentId;
	}

	// Property accessors

	@Column(name = "months", nullable = false, length = 7)
	public String getMonths() {
		return this.months;
	}

	public void setMonths(String months) {
		this.months = months;
	}

	@Column(name = "departmentId", nullable = false, length = 11)
	public String getDepartmentId() {
		return this.departmentId;
	}

	public void setDepartmentId(String departmentId) {
		this.departmentId = departmentId;
	}

	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof DepartmentMonthReportId))
			return false;
		DepartmentMonthReportId castOther = (DepartmentMonthReportId) other;

		return ((this.getMonths() == castOther.getMonths()) || (this
				.getMonths() != null && castOther.getMonths() != null && this
				.getMonths().equals(castOther.getMonths())))
				&& ((this.getDepartmentId() == castOther.getDepartmentId()) || (this
						.getDepartmentId() != null
						&& castOther.getDepartmentId() != null && this
						.getDepartmentId().equals(castOther.getDepartmentId())));
	}

	public int hashCode() {
		int result = 17;

		result = 37 * result
				+ (getMonths() == null ? 0 : this.getMonths().hashCode());
		result = 37
				* result
				+ (getDepartmentId() == null ? 0 : this.getDepartmentId()
						.hashCode());
		return result;
	}

}